Cell phones and other mobile devices have rapidly become the most popular means of recording casual video. Unfortunately, because mobile devices are generally hand-held and lightweight devices operated by amateurs in the spur of the moment, many resulting videos are plagued by camera shake. Such shaking is at best mildly distracting, and at worst, makes the video completely unbearable to watch. Additionally, most mobile cameras use a rolling shutter, in which each horizontal scan line of pixels is exposed and read out in sequence. If the camera or scene objects move during the exposure, each image row captures a slightly different scene, causing motion distortions. Vertical motions cause the image to be squeezed or stretched vertically, and horizontal motions shear the image so that vertical lines tilt to the left or the right.